package com.yuanfeng.business.controller;


import com.yuanfeng.business.dto.FxGoodsInfoDTO;
import com.yuanfeng.business.dto.OperateFxGoodsDTO;
import com.yuanfeng.commoms.dto.goods.FxGoodsListDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopFxGoodsInfoController
 * @Description
 * @Author cyp
 * @Date 2023-06-05 11:43:19
 * @Version 1.0
 **/
@RestController
@RequestMapping("shop/fxGoodsInfo")
public class ShopFxGoodsInfoController extends BaseController {
    /**
     * 分销商品数量更新
     * @param data
     * @return
     */
    @RequestMapping("updateFxGoodsSaleNum")
    public ResponseResult updateFxGoodsSaleNum(@RequestBody String data){
        return shopFxGoodsInfoService.updateFxGoodsSaleNum(data);
    }

    /**
     * 商家中心-分销商品-查询
     *
     * @param param
     * @return
     */
    @PostMapping("/getFxGoodsInfo")
    public ResponseResult getFxGoodsInfo(@RequestBody FxGoodsInfoDTO param) {
        return shopFxGoodsInfoService.getFxGoodsInfo(param);
    }

    /**
     * 添加分销商品 店铺商品列表
     *
     * @param param
     * @return
     */
    @PostMapping("/queryShopGoodsList")
    public ResponseResult queryShopGoodsList(@RequestBody FxGoodsInfoDTO param) {
        return shopFxGoodsInfoService.queryShopGoodsList(param);
    }

    /**
     * 添加 编辑或删除分销商品
     *
     * @param param
     * @return
     */
    @PostMapping("/addRemoveFxGoods")
    public ResponseResult addRemoveFxGoods(@RequestBody OperateFxGoodsDTO param) {
        return shopFxGoodsInfoService.addRemoveFxGoods(param);
    }

    /**
     * 批量添加或移除或删除分销商品
     *
     * @param param
     * @return
     */
    @PostMapping("/addRemoveFxGoodsBatch")
    public ResponseResult addRemoveFxGoodsBatch(@RequestBody OperateFxGoodsDTO param) {
        return shopFxGoodsInfoService.addRemoveFxGoodsBatch(param);
    }

    /**
     * 小程序--推广商品
     * @param goodsListRequest
     * @return
     */
    @PostMapping("/h5/fxGoodsList")
    public ResponseResult fxGoodsList(@RequestBody FxGoodsListDTO goodsListRequest){
        return shopFxGoodsInfoService.fxGoodsList(goodsListRequest);
    }
}
